package com.niit.work02;

import com.niit.work02.Service.Impl.*;
import com.niit.work02.Service.calculateService;

public class operatorFactory {

    public calculateService getOperator(int operator)
    {
        switch (operator)
        {
            case 1:
                return new additionImpl();

            case 2:
                return new subtractionImpl();

            case 3:
                return new multiplicationImpl();

            case 4:
                return new divisionImpl();

            case 5:
                return new modulsImpl();

            case 6:
                return new squareRootImpl();

            default:
                return null;
        }
    }
}
